package DiskInfo;
import java.util.Properties;
import java.io.File;
import javax.swing.filechooser.FileSystemView;

public class Demo {
	 
	public static void main(String[] args) {
		getSystemDisk();
	}
	public static void getSystemDisk(){
		String windir = System.getenv("windir");//读取环境变量，获取系统盘下的Windows目录
		File windirfolder = new File(windir);
		String systemdisk =windirfolder.getParent();// windir.substring(0, windir.indexOf("\\"));
		System.out.println(systemdisk);
		//File systemfile = windirfolder.getParentFile();//获取系统盘根目录
		char x =systemdisk.charAt(0);//系统盘符，例如C（盘）
		char y = (char) (x+1);//系统盘下一个盘符
		System.out.println(y);
		
	}
	public static void getAllDiskList(){
		FileSystemView sys = FileSystemView.getFileSystemView();
        File[] files = File.listRoots();
        for(int i = 0; i < files.length; i++) {
            System.out.println(files[i]);
        }
	}

}
